Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

safe-regex

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

safe-regex

detect possibly catastrophic, exponential-time regular expressions

  • 1.1.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
14M
increased by6.74%
Maintainers
1
Weekly downloads
 
Created

What is safe-regex?

The safe-regex package is a utility for checking if a given regular expression is safe and not susceptible to ReDoS (Regular Expression Denial of Service) attacks. It evaluates the complexity of regular expressions and determines if they can potentially cause exponential time complexity issues.

What are safe-regex's main functionalities?

Safety Check

This feature allows developers to check if a regular expression is safe to use, preventing potential ReDoS attacks. The function returns a boolean indicating whether the regex is considered safe.

const safeRegex = require('safe-regex');
const regex = /a+$/;
console.log(safeRegex(regex)); // Outputs: true or false depending on the safety

Other packages similar to safe-regex

Keywords

FAQs

Package last updated on 19 Mar 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc